package com.hl.mapper;

import com.hl.pojo.HomeCarousel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface HomeCarouselMapper {
    @Select("select * from home_carousel  where del != 1 limit 5")
    public List<HomeCarousel> findAll();
    @Select("select * from home_carousel  where del != 1")
    public List<HomeCarousel> findAll1();

    @Insert("insert into home_carousel(image_path) values(#{imagePath})")
    public int add(HomeCarousel homeCarousel);
    @Update("Update  home_carousel set del = 1 where id = #{id}")
    public int delete(int id);
    @Update("Update  home_carousel set image_path = #{imagePath} where id = #{id}")
    public int update(HomeCarousel homeCarousel);

    @Select("select * from home_carousel where id = #{id}")
    public HomeCarousel findById(int id);

}
